//---------------------------------------------------------------------------
//
// Name:        DeadProxyApp.h
// Author:      Carl Chatfield
// Created:     1/5/2008 6:48:54 PM
// Description: 
//
//---------------------------------------------------------------------------

#ifndef __DEADPROXYFRMApp_h__
#define __DEADPROXYFRMApp_h__

#ifdef __BORLANDC__
	#pragma hdrstop
#endif

#ifndef WX_PRECOMP
	#include <wx/wx.h>
#else
	#include <wx/wxprec.h>
#endif

#include <wx/fileconf.h>

#include "DeadProxyFrm.h"
#include "DeadProxyClientManager.h"
#include "DeadProxyEventLogMessage.h"
#include "DeadProxyGUIEvent.h"

#include "DeadProxyNetworkHandler.h"

#include "DeadProxyCloseHandle.h"
#include "DeadProxyGetFileVersionInfo.h"
#include "DeadProxyLaunchClient.h"

#include "DeadProxyDatReader.h"
#include "DeadProxySprReader.h"



class DeadProxyFrmApp : public wxApp
{
    private:
        void UpdateClientBox(wxString * identifier, int pos, char op);
        void UpdatePacketBox(wxString * identifier, int pos, char op);
        void UpdateMessageBox(wxString * identifier, int pos, char op);
        void UpdateChannelBox(wxString * identifier, int pos, char op);
        void AddClientToBox(wxString * identifier);
		void EditClientInBox(wxString * identifier, int pos);
		void RemoveClientFromBox(int pos);
		
		bool RunLocateClientDlg();
		
		wxString ClientDirectory;
		wxString ClientFullPath;
		
		
	public:
        DeadProxyFrm * frame;
        ClientManager * CManager;
        NetworkHandler * Network;
        DatReader * DataReader;
        SprReader * SpriteReader;
		bool OnInit();
		int OnExit();
		void CloseAllHandles();
		
		void AddPacketToBox(wxString * identifier);
		void EditPacketInBox(wxString * identifier, int pos);
		void RemovePacketFromBox(int pos);
		
		void SetMessageInfo(wxArrayString * MessageInfo);
	    void SetMessageBoxArray(wxArrayString * MessageArray);
	    
	    void AddMessageToBox(wxString * identifier);
	    void ClearMessageBox();
	    
	    void AddChannelToBox(wxString * identifier);
	    void RemoveChannelFromBox(int pos);
	    void ClearChannelBox();
		
		void SetPacketString(wxString * packstr);
		void LogMessage(wxString * output);
		void LogPacket(int sendrecv, unsigned char * buffer, int length);
		void InitClientSelectInfo(Client::InitSelectInfo * ISI);
        void AddClient(int pid, void* handle, bool isStandAlone);
        void RemoveClient(int pos);
        void LaunchClient();
		void TestFunc();
};

extern DeadProxyFrmApp * app;                        

#endif
